#include<bits/stdc++.h>
#define int long long
using namespace std;
#define getchar() (p1 == p2 && (p2 = (p1 = buf1) + fread(buf1, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
char buf1[1 << 23], *p1 = buf1, *p2 = buf1, ubuf[1 << 23], *u = ubuf;
namespace IO
{
	template<typename T>
	void read(T &_x){_x=0;int _f=1;char ch=getchar();while(!isdigit(ch)) _f=(ch=='-'?-1:_f),ch=getchar();while(isdigit(ch)) _x=_x*10+(ch^48),ch=getchar();_x*=_f;}
	template<typename T,typename... Args>
	void read(T &_x,Args&...others){Read(_x);Read(others...);}
	const int BUF=20000000;char buf[BUF],to,stk[32];int plen;
	#define pc(x) buf[plen++]=x
	#define flush(); fwrite(buf,1,plen,stdout),plen=0;
	template<typename T>inline void print(T x){if(!x){pc(48);return;}if(x<0) x=-x,pc('-');for(;x;x/=10) stk[++to]=48+x%10;while(to) pc(stk[to--]);}
}
using namespace IO;
int t,x,ans,l,r,mid,o,o1;
signed main()
{
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
	read(t);
	while(t--)
	{
		read(x);
		if(x == 0){ print(2),pc('\n'); continue; } 
		if(x == 1){ print(3),pc('\n'); continue; } 
		o1 = sqrt(x);
		if(x%2==1)
		{
			ans = x+10; l = x/(max(1ll,o1*2));
			for(int i = l;i <= x;)
			{
				l = x/(x/i);
				for(int j = 0;j <= 1;j++) o = ((l+j)*2-1),ans = min(ans,x/o+(x%o!=0)+(x%o!=0&&x%o%2==0)+o+1);
				i = l+1;break;
			}
		}
		else
		{
			ans = x+10; l = x/(max(1ll,o1*2));
			for(int i = l;i <= x;)
			{
				l = x/(x/i);
				for(int j = 0;j <= 1;j++) o = ((l+j)*2-1),ans = min(ans,x/o+(x%o!=0)+(x%o!=0&&x%o%2==0)+o+1);
				for(int j = 0;j <= 1;j++) o = (l+j)*2,ans = min(ans,x/o+(x%o!=0)+o+1);
				i = l+1;break;
			}
		}
		print(ans),pc('\n');
	}
	flush();
	return 0;
}




